import Vue from 'vue'
import App from './App.vue'
import router from './router'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import './assets/css/global.css'
import axios from 'axios'
import * as echarts from 'echarts';


Vue.prototype.$echarts = echarts
//配置访问的根路径
axios.defaults.baseURL = 'http://localhost:8088/'
//配置每次请求带上token

axios.interceptors.request.use(config => {
  console.log(config)
  config.headers.token = window.sessionStorage.getItem('token')
  // 在最后必须 return config
  return config
})

Vue.prototype.$http = axios
Vue.use(ElementUI);
Vue.config.productionTip = false

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
